package com.example.springboot_demo.pojo;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

@Data
@TableName(autoResultMap = true, value = "`tec_documents`")
@JsonIgnoreProperties(ignoreUnknown = true)
public class TecDocument {

    @TableId
    String columnid;
    String title;
    String url;//https://www.miit.gov.cn+
    Long deploytime;//发布日期
    String date;
    String columnname;//栏目

    String sector;//发文机关
    String fileNumber;//发文字号
    String ctime;//创建时间
    String institution;//发布机构
    String category;


    /**
     * 重组,并购,收购,兼并
     */
    String tag;
    String content;

    public void setUrl(String url) {
        this.url = "https://www.miit.gov.cn"+url;
        this.columnid = url;
    }

    public void setDeploytime(String deploytime) {
        this.deploytime = Long.parseLong(deploytime);
        //同时将时间戳赋值给date。yyyy-MM-dd
        this.date = new java.text.SimpleDateFormat("yyyy-MM-dd").format(new java.util.Date(this.deploytime));
    }
}
